package eva.savant.businessobject;

import javax.persistence.*;
import java.sql.Timestamp;

@MappedSuperclass
public abstract class Entity {

    @Basic
    @Column(name = "OPERACION_ID", length = 10, nullable = false)
    protected Integer operacionId; //Operacion ID

    @Basic
    @Column(name = "SOCIEDAD_ID", length = 10, nullable = false)
    protected String sociedadId; //Sociedad ID

    @Basic
    @Column(name = "USUARIO_ID", length = 25, nullable = false)
    protected Integer usuarioId; //Usuario ID

    @Basic
    @Column(name = "FECHA_ID", length = 19, nullable = false)
    protected Timestamp fechaId; //Fecha Proceso ID

    @Transient
    private boolean check;


    public Integer getOperacionId() {

        return operacionId;
    }

    public void setOperacionId(Integer operacionId) {

        this.operacionId = operacionId;
    }

    public String getSociedadId() {

        return sociedadId;
    }

    public void setSociedadId(String sociedadId) {

        this.sociedadId = sociedadId;
    }

    public Integer getUsuarioId() {

        return usuarioId;
    }

    public void setUsuarioId(Integer usuarioId) {

        this.usuarioId = usuarioId;
    }

    public Timestamp getFechaId() {

        return fechaId;
    }

    public boolean isCheck() {

        return check;
    }

    public void setCheck(boolean check) {

        this.check = check;
    }

    @PreUpdate
    @PrePersist
    public void updateTimeFechaId() {

        this.fechaId = new Timestamp(new java.util.Date().getTime());
    }

}